]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[AltTab] fix Alt-Shift-Tab again
authorDan Winship <danw@gnome.org>
Fri, 27 Aug 2010 19:44:31 +0000 (15:44 -0400)
committerDan Winship <danw@gnome.org>
Mon, 30 Aug 2010 16:28:00 +0000 (12:28 -0400)
In Clutter 1.2, clutter_event_get_keysym() ignored the state of the
Shift key. In 1.4, it does not, so we have to adjust our comparisons
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=627782

js/ui/altTab.js

index f3b6b1ee266cc812aeb115a9d3263f56e1bdd656..0b301678a75aa100f9590141f9fed1ff1ec9b718 100644 (file)
@@ -215,6 +215,9 @@ AltTabPopup.prototype = {
     _keyPressEvent : function(actor, event) {
         let keysym = event.get_key_symbol();
         let shift = (Shell.get_event_state(event) & Clutter.ModifierType.SHIFT_MASK);
+        // X allows servers to represent Shift+Tab in two different ways
+        if (shift && keysym == Clutter.Tab)
+            keysym = Clutter.ISO_Left_Tab;
 
         this._disableHover();
 
@@ -222,17 +225,22 @@ AltTabPopup.prototype = {
         // keys aren't mapped correctly
 
         if (keysym == Clutter.grave)
-            this._select(this._currentApp, shift ? this._previousWindow() : this._nextWindow());
+            this._select(this._currentApp, this._nextWindow());
+        else if (keysym == Clutter.asciitilde)
+            this._select(this._currentApp, this._previousWindow());
         else if (keysym == Clutter.Escape)
             this.destroy();
         else if (this._thumbnailsFocused) {
             if (keysym == Clutter.Tab) {
-                if (shift && (this._currentWindow == 0 || this._currentWindow == -1))
-                    this._select(this._previousApp());
-                else if (!shift && this._currentWindow == this._appIcons[this._currentApp].cachedWindows.length - 1)
+                if (this._currentWindow == this._appIcons[this._currentApp].cachedWindows.length - 1)
                     this._select(this._nextApp());
                 else
-                    this._select(this._currentApp, shift ? this._previousWindow() : this._nextWindow());
+                    this._select(this._currentApp, this._nextWindow());
+            } else if (keysym == Clutter.ISO_Left_Tab) {
+                if (this._currentWindow == 0 || this._currentWindow == -1)
+                    this._select(this._previousApp());
+                else
+                    this._select(this._currentApp, this._previousWindow());
             } else if (keysym == Clutter.Left || keysym == Clutter.a)
                 this._select(this._currentApp, this._previousWindow());
             else if (keysym == Clutter.Right || keysym == Clutter.d)
@@ -241,7 +249,9 @@ AltTabPopup.prototype = {
                 this._select(this._currentApp, null, true);
         } else {
             if (keysym == Clutter.Tab)
-                this._select(shift ? this._previousApp() : this._nextApp());
+                this._select(this._nextApp());
+            else if (keysym == Clutter.ISO_Left_Tab)
+                this._select(this._previousApp());
             else if (keysym == Clutter.Left || keysym == Clutter.a)
                 this._select(this._previousApp());
             else if (keysym == Clutter.Right || keysym == Clutter.d)